import React, { Suspense, lazy } from 'react';
import { Switch, Redirect, Route } from 'react-router-dom';
import Loading from "../components/Loading"

const Login = lazy(() => import("../views/login/Index"))
const Dashboard = lazy(() => import("../views/backend/Dashboard"))
const Index = () => {
    return (
        <Suspense fallback={<Loading/>}>
            <Switch>
                <Redirect exact from="/" to="/login" />
                <Route path="/login" component={Login} />
                <Route path="/Dashboard" component={Dashboard} />
            </Switch>
        </Suspense>
    );
}

export default Index;
